<@ms.html5>
	<@ms.nav title="订单管理" back=true></@ms.nav>
	<@ms.panel>
				<@ms.searchForm  name="searchForm" id="searchForm" action="${managerPath}/order/list.do">
							<@ms.text label="订单编号"  name="orderCode"  title="请输入订单编号"  placeholder="请输入订单编号" value="${orderCode?default('')}"   />			  
							<@ms.text label="车牌号"  name="carPlateNumber"  title="请输入车牌号"  placeholder="请输入车牌号" value="${carPlateNumber?default('')}"   />			  
							<@ms.text label="服务单位"   name="enterpriseName"  title="请输入服务单位"  placeholder="请输入服务单位" value="${enterpriseName?default('')}"   />
							<#assign status=[{"id":"0","name":"全部"},{"id":"1","name":"待审核"},{"id":"2","name":"待确认"},{"id":"3","name":"待维修"},{"id":"4","name":"待评价"},{"id":"5","name":"已完成"},{"id":"6","name":"已关闭"}]>
							<@ms.select label="订单状态" list=status listValue="name" listKey="id"    name="orderStatus" value="${orderStatus?default(0)}" />
							<#assign status=[{"id":"-1","name":"全部"},{"id":"0","name":"未回访"},{"id":"1","name":"已回访"}]>
							<@ms.select label="回访状态" list=status listValue="name" listKey="id"    name="orderFollowStatus" value="${orderFollowStatus?default(-1)}" />
							<div class="form-group ms-form-group col-sm-4" style="height:35px;"></div>
							<@ms.date label="创建时间" name="orderCreateTime"     value="${orderCreateTime?default('')}" />
							<@ms.date label="预约时间" name="orderAppointTime"     value="${orderAppointTime?default('')}" />
						<@ms.searchFormButton>
								<@ms.queryButton id="submitSearch"/>								
						</@ms.searchFormButton>
				</@ms.searchForm>
				
				<@ms.table head=['<th class="text-center">序号</th>','<th class="text-center">订单编号</th>','<th class="text-center">车牌号</th>','<th class="text-center">服务单位</th>','<th class="text-center">预估金额</th>','<th class="text-center">实收金额</th>','<th class="text-center">创建时间</th>','<th class="text-center">预约时间</th>','<th class="text-center">订单状态</th>','<th class="text-center">回访状态</th>']>
						<#if orderList?has_content>
		        			<#list orderList as order>
		           				<tr>
		           					<td class="text-center">${order_index+1}</td>
						            <td class="text-center"><a href="${managerPath}/order/${order.orderCode}/detail.do?${params}&pageNo=${pageNo}">${order.orderCode?default("-")}</a></td>
						            <td class="text-center">${order.carPlateNumber?default("-")}</td>
						            <td class="text-center">${order.enterpriseName?default("-")}</td>
						            <td class="text-center"><#if order.orderTotalAmount??>#{order.orderTotalAmount;m2M2}<#else>-</#if></td>
						            <td class="text-center"><#if order.orderReceiveAmount??>#{order.orderReceiveAmount;m2M2}<#else>-</#if></td>
						            <td class="text-center">${order.orderCreateTime?string("yyyy-MM-dd HH:mm:ss")}</td>
						            <td class="text-center"><#if order.orderAppointTime??>${order.orderAppointTime?string("yyyy-MM-dd HH:mm:ss")}<#else>-</#if></td>
						            <td class="text-center">
						            <#if order.orderStatus == 1>  
						            	待审核
						            <#elseif order.orderStatus == 2>
						            	待确认
						            <#elseif order.orderStatus == 3>
						            	待维修
						            <#elseif order.orderStatus == 4>
						            	待评价
						            <#elseif order.orderStatus == 5>
						            	已完成	
						            <#elseif order.orderStatus == 6>
						            	已关闭
						            </#if> 
						            </td>
						            <td class="text-center">
						            <#if order.orderFollowStatus == 0>  
						            	未回访
						            <#elseif order.orderFollowStatus == 1>
						            	已回访
						            </#if> 
						            </td>
						        </tr>
		           			</#list>
		           		<#else>	
			           		<tr>
						         <td colspan="10" class="text-center">
						            <@ms.nodata/>
								</td>
					        </tr>
		           		</#if>
					</@ms.table>
					<!--分页样式 开始-->
					<#if page?has_content>
						<@ms.pagehelper page=page url="${managerPath}/order/list.do?${params}"/>
					</#if>	
	</@ms.panel>
</@ms.html5>
<script>
	$(function(){
		//根据条件查询订单
		$("#submitSearch").click(function() {
			$("#searchForm")[0].submit();
		});
	});
	//js监听回车键 
	document.onkeydown = function(e) {
		e = e ? e : window.event;
		var keyCode = e.which ? e.which : e.keyCode;
		if (keyCode == 13) {
			$("#searchForm")[0].submit();
		}
	}
</script>